/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */
package com.yami.shop.distribution.common.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
import com.yami.shop.distribution.common.dto.DistributionUserAchievementDataDto;
import com.yami.shop.distribution.common.vo.DistributionUserVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
/**
 * @author yami
 */
@Data
@TableName("tz_distribution_user")
public class DistributionUser implements Serializable {

    @ApiModelProperty("促销员表id")
    @TableId(type = IdType.AUTO)
    private Long distributionUserId;

    @ApiModelProperty("店铺id")
    private Long shopId;

    @ApiModelProperty("卡号")
    private String cardNo;

    @ApiModelProperty("用户id")
    private String userId;

    @ApiModelProperty("上级id")
    private Long parentId;

    @ApiModelProperty("上级促销员ids （如：1,2,3）最上级处于最前面的位置")
    private String parentIds;

    @ApiModelProperty("层级（0顶级）")
    private Integer grade;

    @ApiModelProperty("关联等级id")
    private Integer level;

    @ApiModelProperty("分组id")
    private Long groupId;

    @ApiModelProperty("状态(-1永久封禁 0 待审核 1 正常 2 暂时封禁 3 审核未通过，需要重新申请)")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date bindTime;

    @ApiModelProperty("状态(-1永久封禁 0 待审核 1 正常 2 暂时封禁 3 审核未通过，需要重新申请)")
    private Integer state;

    @ApiModelProperty("用户昵称")
    private String nickName;

    @ApiModelProperty("手机号码")
    private String userMobile;

    @ApiModelProperty("真实姓名")
    private String realName;

    @ApiModelProperty("身份证号")
    private String identityCardNumber;

    @ApiModelProperty("改变成永久封禁或者暂时封禁时的状态记录")
    private Integer stateRecord;

    @ApiModelProperty("身份证正面")
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String identityCardPicFront;

    @ApiModelProperty("身份证背面")
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String identityCardPicBack;

    @ApiModelProperty("手持身份证照片")
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String identityCardPicHold;

    @ApiModelProperty("头像")
    private String pic;

    @ApiModelProperty("上级分销员")
    @TableField(exist = false)
    private DistributionUserVO parentDistributionUser;

    @ApiModelProperty("分销员收入记录")
    @TableField(exist = false)
    private DistributionUserIncome distributionUserIncome;

    @ApiModelProperty("分销员各项数据")
    @TableField(exist = false)
    private DistributionUserAchievementDataDto distributionUserAchievementDataDto;

    @ApiModelProperty("排序字段" +
            "分销管理-分销员管理： 0无 1加入时间 2累计客户 3累计邀请 4累计收益" +
            "分销管理-业绩统计： 0无 1一代佣金 2二代佣金 3邀请奖励 4待结算金额 5可提现金额 6已失效金额")
    @TableField(exist = false)
    private Integer sortParam = 0;

    @ApiModelProperty("排序类型 0无 1 正序 2倒序")
    @TableField(exist = false)
    private Integer sortType = 0;
}
